require 'migration_helpers'

class CreateReportCards < ActiveRecord::Migration
  extend MigrationHelper::ForeignKeys
  
  def self.up
    create_table :report_cards do |t|
      t.column :grade_id,             :integer
      t.column :courses_sessions_id,  :integer
      t.column :report_date,          :date
      t.column :notes,                :text
      t.column :created_at,           :date
      t.column :updated_at,           :date
    end
    
    add_foreign_key(:report_cards, :grade_id, :grades)
    add_foreign_key(:report_cards, :courses_sessions_id, :courses_sessions)
  end

  def self.down
    drop_table :report_cards
  end
end
